package com.example.tests;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import org.testng.annotations.Test;
import com.example.fw.ContactObject;
import com.example.fw.Contacts;

public class ContactModificationTests extends TestBase{

	
	@Test(dataProvider = "randomContacts", dataProviderClass = ContactDataGenerator.class)
	public void testContactModification(ContactObject validContact ) throws Exception {
		Contacts oldList = app.getContactHelper().getContacts();
		ContactObject someContact = oldList.getSomeContact();	
		app.getContactHelper().modifyContact(someContact, validContact);
			Contacts newList = app.getContactHelper().getContacts();
	//		verifyContactModified(oldList, validContact, newList);
			assertThat(newList, equalTo(oldList.withoutRemoved(someContact).withAdded(validContact)));
			;
		}

			
		
//		ContactModificationOblect modifyContactData = new ContactModificationOblect("mmtestname", "mmtestlastname", "mmtestaddress", "mmtesthome", "mmtestmobile", "mmtestwork", "mmtestmail", "mmtestmail2", "2", "March", "1960", "mmtestaddress2",
//				"mmtesthome2");
//		app.getContactHelper().modifyContact(modifyContactData);
//		;	
		
	}
